package org.AI.Language.GUI;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import java.util.Vector;

import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities;
import javax.swing.border.BevelBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;


/**
 * 人机对话界面
 * @author Luc
 */
public class Mainframe{
	private JFrame frame = new JFrame("AI Language 1.0");
	private JPanel centerPanel = new JPanel();
	private JTextArea diagField = new JTextArea();
	JScrollPane textPane = new JScrollPane(diagField);
	private JPanel southPanel = new JPanel();
	private JTextArea inputField = new JTextArea();
	JScrollPane inputPane = new JScrollPane(inputField);
	
	public Mainframe(){
		///////////////////////init main frame//////////////////////////
		Container con = frame.getContentPane();
		frame.setSize(350,400);
		frame.setResizable(true);
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        frame.setLocation((screenSize.width-frame.getWidth())/2, (screenSize.height-frame.getHeight())/2);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		con.setLayout(new BorderLayout());
		/////////////////////////////////////////////////////////////
		///////////////////////north panel///////////////////////////
		/////////////////////////////////////////////////////////////
		centerPanel.setLayout(new BorderLayout());
		inputField.setColumns(30);
		inputField.setRows(5);
		centerPanel.add(textPane);
		southPanel.add(inputPane);
		con.add(centerPanel, BorderLayout.CENTER);
		con.add(southPanel, BorderLayout.SOUTH);
		frame.setVisible(true);
	}

}
